<a href="admin/modules/tangra_cms/nomenclature/nomenclatures.php" class="action_back">Back to nomenclatures list</a><br /><br />
<table width="800" border="1" cellspacing="0" cellpadding="0" class="info_page_main_table">
    <tr>
        <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="info_page_section_table">
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="1" cellpadding="4">
                            <tr>
                                <td align="right" width="250" class="info_page_label_cell">Name</td>
                                <td align="left" class="info_page_content_cell">{$nom->get_name()}</td>
                            </tr>
                            <tr>
                                <td align="right" width="250" class="info_page_label_cell">HID</td>
                                <td align="left" class="info_page_content_cell">{$nom->get_hid()}</td>
                            </tr>
                        </table>
                    </td>
                    <td class="info_page_link_cell" align="center" width="100"><a href="admin/modules/tangra_cms/nomenclature/nomenclature_edit.php?nomenclature_obj_id={$nom->get_id()}">Edit</a></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<br />
<br />
<a href="admin/modules/tangra_cms/nomenclature/nomenclature_value_edit.php?nomenclature_value_add_new=1" class="action_add">Create new value</a> <br />
<br />
<script type="text/javascript">
// ********************* Grid nomenclature_values START
var _tm = '{$_tm}';
var _transit_vars_par = ''{foreach from=$_transit_vars item=tvar_value key=tvar_key} + '&' + '{$tvar_key}={$tvar_value}'{/foreach};
var nomenclature_values_additional_parameters_par = ''{foreach from=$nomenclature_values_additional_parameters item=ap_var_value key=ap_var_key} + '&' + '{$ap_var_key}={$ap_var_value}'{/foreach};
{literal}
function submit_ajax_grid_nomenclature_values(page) {
{/literal}
	var pars = 'nomenclature_values_grid_page=' + page + '&' + '_tm=' + _tm + _transit_vars_par + nomenclature_values_additional_parameters_par;
{literal}
	fade_out_div();
	var myAjax = new Ajax.Request(
                                    "ajax/grids/nomenclature_values_grid.php",
                                    {
                                                method: 'get',
                                                onComplete: nomenclature_values_result,
                                                onSuccess: nomenclature_values_on_success,
                                                onFailure: nomenclature_values_on_failure,
												parameters: pars
                                    }          );
}


function nomenclature_values_result(req, json) {
	if (json) {
		var old_tm = _tm;
		_tm = json._tm;

		// refreshing _tm on all links that are outside of updated area
		for (var i=0; i < document.links.length; i++) {
 		  	document.links[i].href = document.links[i].href.replace(old_tm, _tm);
		}


		if (json.result_code == 1) { // OK
				switch(json.command) {
					case 'redirect':
						window.location = json.command_value;
						break;
					case 'show' :
					default :
						grid_div = $('nomenclature_values_grid_div');
						grid_div.innerHTML = req.responseText;
						break;
				}
		} else {
				// something is wrong
				if (_site_mode == 0) {
					//if in development mode - show the output anyway (if any).
					grid_div = $('nomenclature_values_grid_div');
					grid_div.innerHTML = req.responseText;
				}
		}
	} else {
		// no result_code, some serious error/exception occured.
		if (_site_mode == 1) {
			window.location = _server_error_page;
		} else {
			//if in development mode - show the output anyway (if any).
			grid_div = $('nomenclature_values_grid_div');
			grid_div.innerHTML = req.responseText;
		}
	}
}


function fade_out_div() {
	var overlay = $('nomenclature_values_overlay');
	var grid_div = $('nomenclature_values_grid_div');

	Position.clone(grid_div, overlay)
	var image = $('nomenclature_values_waiting');

	overlay.style.display = 'block';
	var image_top_offset = Math.round((overlay.offsetHeight - image.height) / 2);
	image.style.marginTop = image_top_offset + 'px';
}


function fade_in_div() {
	var overlay = $('nomenclature_values_overlay');
	overlay.style.display = 'none';
}


function nomenclature_values_on_success() {
	fade_in_div();
}


function nomenclature_values_on_failure() {
	fade_in_div();
}


function nomenclature_values_page_change(page) {
	submit_ajax_grid_nomenclature_values(page);
}


{/literal}
// ********************* Grid nomenclature_values END
</script>
<div id="nomenclature_values_grid_div" style="width:600px;">
{include file="modules/tangra_cms/grids/nomenclature_values_grid.tpl"}
</div>
<div class="metallic_ajax_overlay_grid" id="nomenclature_values_overlay" style="display:none; position: absolute; z-index: 90;" align="center"><img src="img/modules/grid_html_tpl_static_ajax_metallic/indicator_medium.gif" onclick="return true;" id="nomenclature_values_waiting" alt="" /></div>
